package com.ruoyi.user.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.user.mapper.WalletTransactionLogMapper;
import com.ruoyi.user.domain.WalletTransactionLog;
import com.ruoyi.user.service.IWalletTransactionLogService;

/**
 * 零钱流水Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-21
 */
@Service
public class WalletTransactionLogServiceImpl implements IWalletTransactionLogService 
{
    @Autowired
    private WalletTransactionLogMapper walletTransactionLogMapper;

    /**
     * 查询零钱流水
     * 
     * @param txnId 零钱流水主键
     * @return 零钱流水
     */
    @Override
    public WalletTransactionLog selectWalletTransactionLogByTxnId(String txnId)
    {
        return walletTransactionLogMapper.selectWalletTransactionLogByTxnId(txnId);
    }

    /**
     * 查询零钱流水列表
     * 
     * @param walletTransactionLog 零钱流水
     * @return 零钱流水
     */
    @Override
    public List<WalletTransactionLog> selectWalletTransactionLogList(WalletTransactionLog walletTransactionLog)
    {
        return walletTransactionLogMapper.selectWalletTransactionLogList(walletTransactionLog);
    }

    /**
     * 新增零钱流水
     * 
     * @param walletTransactionLog 零钱流水
     * @return 结果
     */
    @Override
    public int insertWalletTransactionLog(WalletTransactionLog walletTransactionLog)
    {
        return walletTransactionLogMapper.insertWalletTransactionLog(walletTransactionLog);
    }

    /**
     * 修改零钱流水
     * 
     * @param walletTransactionLog 零钱流水
     * @return 结果
     */
    @Override
    public int updateWalletTransactionLog(WalletTransactionLog walletTransactionLog)
    {
        return walletTransactionLogMapper.updateWalletTransactionLog(walletTransactionLog);
    }

    /**
     * 批量删除零钱流水
     * 
     * @param txnIds 需要删除的零钱流水主键
     * @return 结果
     */
    @Override
    public int deleteWalletTransactionLogByTxnIds(String[] txnIds)
    {
        return walletTransactionLogMapper.deleteWalletTransactionLogByTxnIds(txnIds);
    }

    /**
     * 删除零钱流水信息
     * 
     * @param txnId 零钱流水主键
     * @return 结果
     */
    @Override
    public int deleteWalletTransactionLogByTxnId(String txnId)
    {
        return walletTransactionLogMapper.deleteWalletTransactionLogByTxnId(txnId);
    }

    /**
     * 根据用户ID和钱包ID查询零钱流水列表
     * 
     * @param customerId 用户ID
     * @param walletId 钱包ID
     * @return 零钱流水集合
     */
    @Override
    public List<WalletTransactionLog> selectWalletTransactionLogByCustomerIdAndWalletId(String customerId, String walletId)
    {
        return walletTransactionLogMapper.selectWalletTransactionLogByCustomerIdAndWalletId(customerId, walletId);
    }
}
